<template>
	<view class="mainpadding" style="padding-bottom: 150rpx;" v-if="pageShow">
		<!-- 1=待支付,2=待乘车,3=已完成,4=取消审核中,5=已取消 -->
		<view class="xiaohei bigtext textcenter fonweight" v-if="dataAll.state==2">{{dataAll.cc_time_text}} {{dataAll.tourist_time_name}}出发</view>
		<view class="" v-if="dataAll.state!=2">
			<text class="xiaohei ershiba">订单状态：</text>
			<text class="xiaohong ershiba" v-if="dataAll.state==1">待支付</text>
			<text class="xiaolan ershiba" v-if="dataAll.state==2">待出行</text>
			<text class="xiaolv ershiba" v-if="dataAll.state==3">已完成</text>
			<view class="xiaohuang ershiba" v-if="dataAll.state==4">取消审核中</view>
			<text class="xiaohui ershiba" v-if="dataAll.state==5">已取消</text>
		</view>
		<view class="mainpadding_top ffffff radius">
			<view class="flexbetween">
				<view class="xiaohei sanshier">上车点</view>
			</view>
			<view class="margin_top2">
				<text class="lvdian margin_right2"></text>
				<text class="xiaohui ershiba ">{{dataAll.start_tourist_site_name}}</text>
			</view>
			<view class="flexbetween">
				<view class="xiaohei margin_top sanshier">下车点</view>
			</view>
			<view class="margin_top2">
				<text class="huangdian margin_right2"></text>
				<text class="xiaohui ershiba ">{{dataAll.end_tourist_site_name}}</text>
			</view>
		</view>
		<view class="mainpadding_top ffffff radius">
			<view class="xiaohei sanshier">乘车人信息</view>
			<view class="xiahuaxian margin_top" v-for="item in dataAll.goods" :key="item.id">
				<view>
					<text class="xiaohei ershiba margin_right3">{{item.name}}</text>
					<text class="xiaohei lable">{{item.datatype}}</text>
				</view>
				<view class="xiaohui margin_top1 ershil">证件号：{{item.idcard}}</view>
			</view>
		</view>
		<view class="mainpadding_top ffffff radius">
			<view class="xiaohei sanshier">订单信息</view>
			<view class="flexbetween margin_top">
				<view class="xiaohui ershil">订单总金额</view>
				<view class="xiaolan titletext fonweight">￥{{dataAll.pay_price}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="xiaohui ershil">订单编号</view>
				<view class="xiaohei titletext fonweight">{{dataAll.order_no}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="xiaohui ershil">创建时间</view>
				<view class="xiaohei titletext fonweight">{{dataAll.createtime_text}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="xiaohui ershil">联系人</view>
				<view class="xiaohei titletext fonweight">{{dataAll.lxname}}</view>
			</view>
			<view class="flexbetween margin_top">
				<view class="xiaohui ershil">联系电话</view>
				<view class="xiaohei titletext fonweight">{{dataAll.lxtel}}</view>
			</view>
		</view>
		<view class="mainpadding gudingdb ffffff" v-if="dataAll.state==2">
			<view class="bigbtn" @click="hexiao">确认核销</view>
		</view>
	</view>
</template>

<script>
	const httpRequest = require("@/common/httpRequest.js")
	export default {
		data() {
			return {
				dataAll:{},
				pageShow:false,
				listid:""
			}
		},
		onLoad(options) {
			this.listid = options.id
		},
		onShow() {
			this.getdetail()
		},
		methods: {
			getdetail(){
				httpRequest.request('/api/Travelcl/getOrderInfo','GET',{
					id:this.listid
				}).then(res => {
					this.dataAll = res.data
					this.pageShow = true
				})
			},
			hexiao(){
				httpRequest.request('/api/Travelcl/hxOrder','GET',{
					id:this.listid
				}).then(res => {
					httpRequest.toast(res.msg)
					if(res.code==1){
						setTimeout(()=>{
							uni.navigateBack(1)
						},500)
					}
				})
			},
		}
	}
</script>

<style>
.lable {
		padding: 0 8rpx;
		border: 1rpx solid #999;
		font-size: 20rpx;
	}
</style>
